home *** CD-ROM | disk | FTP | other *** search
Text File | 1986-12-08 | 1.4 KB | 31 lines | [TEXT/ttxt] |
- 00 ILIT 20 LOAD THE TOTAL NO. OF EVEN NUMBERS WE WANT TO GET
- 01 ILIT 0 LOAD THE NUMBER WE START WITH
- 02 LOAD 0 0 PUSH THE CONTENT OF ADDRESS 0 TO THE TOP
- 03 ILIT 0 LOAD 0 TO THE TOP
- 04 LSEQ TEST WHETHER THE CONTENT OF ADRESS 0 IS <= 0
- 05 BRTR 25 IF IT IS TRUE, BRANCH TO 25
- 06 LOAD 0 0 PUSH THE CONTENT OF ADDRESS 0 TO THE TOP
- 07 ILIT 1 PUSH 1 TO THE TOP
- 08 SUB CREATE THE DIFFERENCE ON THE TOP
- 09 STOR 0 0 STORE THE DIFFERENCE BACK TO ADDRESS 0
- 10 DUPL MAKE A COPY OF THE LAST NUMBER WE GOT
- 11 DUPL MAKE ANOTHER COPY
- 12 ILIT 2 PUSH 2 TO THE TOP
- 13 DIV DIVIDE THE SECOND COPY BY 2
- 14 ILIT 2 PUSH 2 TO THE TOP
- 15 MUL MULTIPLY THE QUOTIENT WE GOT BY 2
- 16 NEQL TEST WHETHER THE PRODUCT IS <> THE FIRST COPY
- 17 BRTR 22 IF THEY ARE NOT EQUAL, BRANCH TO 22
- 18 DUPL MAKE A COPY OF THE EVEN NUMBER WE JUST GOT
- 19 ILIT 1 PUSH 1 TO THE TOP
- 20 ADD ADD 1 TO THE COPY TO CREATE THE NEXT NUMBER TO STUDY
- 21 BUNC 2 GO BACK TO LINE 2
- 22 ILIT 1 PUSH 1 TO THE TOP
- 23 ADD ADD 1 TO THE NUMBER JUST TESTED TO CREATE THE NEXT
- 24 BUNC 10 GO BACK TO LINE 10
- 25 POP 1 REMOVE THE NUMBER ON THE TOP
- 26 STOP THE FIRST 20 EVEN NUMBERS ARE IN ADDRESS 1 TO 20
- DUMP
- NOOP THIS PROGRAM PUSHS TO THE DATA STACK THE FIRST 20 EVEN NUMBERS.
- NOOP TO GET THE FIRST N, USE "ILIT N" IN LINE 00
-